<template>
  <p v-for="s in strSplit" 
     :style="{'margin': spacing+' 0'}" >
<!--     v-if="s!==''">-->
    {{s}}
  </p>
</template>

<script>
export default {
  name: "TextToP",
  props: {
    text: {
      type: String
    },
    spacing: {
      type: String,
      default: '5px'
    }
  },
  computed: {
    strSplit(){
      if(this.text===null || this.text === '')
        return []
      return this.text.split("\n")
    }
  }
}
</script>

<style scoped>

</style>